home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 4
/
Aminet 4 - November 1994.iso
/
aminet
/
comm
/
net
/
dnet2_10_13.lha
/
DNet
/
Amiga
/
Sourcen.lha
/
doshand
/
dos.h
< prev
next >
Wrap
C/C++ Source or Header
|
1993-01-14
|
4KB
|
208 lines
/*
* DOS.H
*/
#include <stdio.h>
#include <local/typedefs.h>
#include <local/xmisc.h>
#include "/server/servers.h"
#include "/dnet/channel.h"
#include "/lib/dnetlib.h"
#ifdef LATTICE
#include <stdlib.h>
#include <string.h>
#endif
#ifdef NOTDEF
#include "exec/types.h"
#include "exec/memory.h"
#include "libraries/dos.h"
#include "libraries/dosextens.h"
#include "libraries/filehandler.h"
#endif NOTDEF
/*
* ACTIONS which do not exist in dosextens.h but which indeed exist on
* the Amiga.
*/
#define ACTION_OPENRW 1004
#define ACTION_OPENOLD 1005
#define ACTION_OPENNEW 1006
#define ACTION_CLOSE 1007
#define ACTION_SEEK 1008
#define ACTION_RAWMODE 994
#define ACTION_MORECACHE 18
#define ACTION_FLUSH 27
#define DOS_FALSE 0
#define DOS_TRUE -1
typedef struct DosPacket PACKET;
typedef struct DeviceNode DEVNODE;
typedef struct DeviceList DEVLIST;
typedef struct DosInfo DOSINFO;
typedef struct RootNode ROOTNODE;
typedef struct FileHandle FH;
typedef struct DateStamp STAMP;
typedef struct InfoData INFODATA;
typedef struct DosLibrary DOSLIB;
#define FILE_DIR 1
#define FILE_FILE -1
#define LOCKLINK struct _LOCKLINK
#define HANDLE struct _HANDLE
/*
* We use this structure to link locks together in a list for internal
* usage. I could have use the link field in the lock structure as a
* real linked list, but didn't want to have to sequentially search the
* list to remove a node.
*
* NOTE: You CANNOT simply extend the FileLock (LOCK) structure. Some
* programs assume it is sizeof(LOCK) big and break. I found this out the
* hard way.
*/
LOCKLINK {
NODE Node;
LOCK *Lock;
};
/*
* OPERATION STRUCTURES
*/
typedef struct {
long DirHandle; /* relative to directory (0=root) */
uword Modes; /* open modes */
} OpOpen;
typedef struct {
long Handle;
ulong Prot;
long Type;
long Size;
STAMP Date; /* date stamp */
} RtOpen;
typedef struct {
long Handle; /* file handle to read from */
long Bytes; /* # of bytes to read */
} OpRead;
typedef struct {
long Bytes; /* < 0 == error */
} RtRead;
typedef struct {
long Handle; /* file handle to read from */
long Bytes; /* # of bytes to read */
} OpWrite;
typedef struct {
long Bytes; /* < 0 == error */
} RtWrite;
typedef struct {
long Handle;
} OpClose;
typedef struct {
long Handle;
long Offset;
long How;
} OpSeek;
typedef struct {
long OldOffset;
long NewOffset; /* -1 = error */
} RtSeek;
typedef struct {
long Handle;
} OpParent;
typedef RtOpen RtParent;
typedef struct {
long DirHandle;
} OpDelete;
typedef struct {
long Error;
} RtDelete;
typedef OpDelete OpCreateDir;
typedef RtParent RtCreateDir;
typedef struct {
long Handle;
} OpDup;
typedef RtOpen RtDup;
typedef struct {
long Handle; /* oops, actually a directory handle */
long Index;
} OpNextDir;
typedef RtOpen RtNextDir;
typedef struct {
long DirHandle1;
long DirHandle2;
} OpRename;
typedef struct {
long Error;
} RtRename;
/*
* Filehandle structure associated with an open file handle
*/
#define MAGIC 0x1AFB439C
HANDLE {
NODE Node; /* link node */
long Magic;
LOCK *Lock; /* lock if any */
long Handle; /* remote handle */
short Type; /* file type */
ulong Prot; /* protection bits */
ulong Size; /* file size */
STAMP Date; /* date stamp */
char *Name; /* file name */
};
/*
* (void *) in Aztec C means 'pointer to anything'. I use it
* extensively.
*/
/* REMOVED
extern void returnpacket();
extern void *GetLockForHandle();
extern HANDLE *GetHandleForLock();
extern void *AllocMem(), *RemHead(), *GetMsg();
extern void *FindTask(), *Open(), *OpenLibrary();
extern void *dosalloc(), *GetSucc(), *GetHead();
extern LOCK *ramlock();
extern char *bstos();
extern char *skipdevice();
extern HANDLE *getlockfile();
extern char *getpathelement();
extern char *typetostr();
*/